#!/bin/env python
# coding:utf-8


from django.db import models


# 需要展示的数据 当日收入,付费用户数,付费金额,arpu,arppu,新增玩家的付费人数,新增玩家的付费金额,今日新增用户付费率
class Analysedata(models.Model):
    user_id = models.BigIntegerField(primary_key=True)
    game_id = models.SmallIntegerField()
    main_channel = models.IntegerField()
    sub_channel = models.IntegerField()
    game_date = models.CharField(max_length=10)
    new_user_num = models.IntegerField()
    login_user_num = models.IntegerField()
    day_2_retained = models.CharField(max_length=8)
    day_3_retained = models.CharField(max_length=8)
    day_7_retained = models.CharField(max_length=8)
    pay_user_num = models.IntegerField()
    pay_user_money = models.IntegerField()
    game_arpu = models.FloatField()
    game_arppu = models.FloatField()
    new_pay_user_num = models.IntegerField()
    new_pay_user_money = models.IntegerField()
    new_user_pay_ratio = models.CharField()
    login_user_pay_ratio = models.CharField()
    day_15_ltv = models.FloatField()
    day_30_ltv = models.FloatField()


# 渠道列表
class Gamechannel(models.Model):
    channel_id = models.IntegerField(primary_key=True)
    channel_level = models.SmallIntegerField()
    pardent_id = models.IntegerField()
    game_id = models.SmallIntegerField()
    status = models.SmallIntegerField()
    create_user = models.SmallIntegerField()
    create_time = models.DateTimeField(auto_now_add=True)
    update_user = models.SmallIntegerField()
    update_time = models.DateTimeField(auto_now=True)


# 用户表
class Userstatus(models.Model):
    user_id = models.IntegerField(primary_key=True)
    account_id = models.CharField(max_length=40)
    nickname = models.CharField(max_length=40)
    password = models.CharField(max_length=40)
    email = models.CharField(max_length=30)
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)
    user_status = models.SmallIntegerField()
    user_remark = models.CharField(max_length=40)


# 游戏表
class Gamestatus(models.Model):
    game_id = models.SmallIntegerField()
    game_name = models.CharField(max_length=20)
    create_time = models.DateTimeField(auto_now_add=True)
    status = models.SmallIntegerField()

